<template>
  <div class="home">
    <!-- <p>home->vfor</p> -->
    <v-for1 @tabClick="tabClick" :titles="tabData.titles" v-show="true"></v-for1>
    <contents :datalist="showDataList"></contents>
  </div>
</template>

<script>
// @ is an alias to /src
// import HelloWorld from '@/components/HelloWorld.vue'
import VFor1 from "../components/vfor/VFor1";
import Content from "../components/vfor/Content";

export default {
  name: "home",
  components: {
    // HelloWorld
    "v-for1": VFor1,
    contents: Content
  },
  data() {
    return {
      tabData: {
        titles: ["娱乐", "军事", "动漫"],
        DataList: {
          fans: {list:["fans", "fans", "fans", "fans", "fans", "fans"]},
          junshi: {list:["junshi", "junshi", "junshi", "junshi", "junshi", "junshi"]},
          dongman: {list:[
            "dongman",
            "dongman",
            "dongman",
            "dongman",
            "dongman",
            "dongman"
          ]}
        },
        currentType: "fans"
      }
    };
  },
  methods: {
    tabClick(index) {
      this.tabData.currentType=Object.keys(this.tabData.DataList)[index]
    }
  },
  computed:{
    showDataList(){
      return this.tabData.DataList[this.tabData.currentType].list
    }
  }
};
</script>
